Everything about Run-length Encoding totally explained
Run-length encoding (
RLE) is a very simple form of
data compression in which
runs of data (that is, sequences in which the same data value occurs in many consecutive data elements) are stored as a single data value and count, rather than as the original run. This is most useful on data that contains many such runs: for example, relatively simple graphic images such as icons, line drawings, and animations.
For example, consider a screen containing plain black text on a solid white background. There will be many long runs of white
pixels in the blank space, and many short runs of black pixels within the text. Let us take a hypothetical single
scan line, with B representing a black pixel and W representing white:
» WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
If we apply the run-length encoding (RLE) data
compression algorithm to the above hypothetical scan line, we get the following:
» 12W1B12W3B24W1B14W
Interpret this as twelve W's, one B, twelve W's, three B's, etc.
The run-length code represents the original 67 characters in only 18. Of course, the actual format used for the storage of images is generally binary rather than
ASCII characters like this, but the principle remains the same. Even binary data files can be compressed with this method; file format specifications often dictate repeated bytes in files as padding space. However, newer compression methods such as
DEFLATE often use
LZ77-based algorithms, a generalization of run-length encoding that can take advantage of runs of strings of characters (such as BWWBWWBWWBWW).
Common formats for run-length encoded data include
TGA,
PackBits,
PCX and
ILBM.
Run-length encoding performs
lossless data compression and is well suited to
palette-based iconic images. It doesn't work well at all on continuous-tone images such as photographs, although
JPEG uses it quite effectively on the coefficients that remain after transforming and
quantizing image blocks.
Run-length encoding is used in
fax machines (combined with other techniques into
Modified Huffman coding). It is relatively efficient because most faxed documents are mostly white space, with occasional interruptions of black.
Data that have long sequential runs of bytes (such as lower-quality
sound samples) can be RLE compressed after applying a predictive filter such as
delta encoding.
Further Information
Get more info on 'Run-length Encoding'.
|
External Link Exchanges
Do you know how hard it is to get a link from a large encyclopaedia? Well we're different and will prove it. To get a link from us just add the following HTML to your site on a relevant page:
<a href="http://run-length_encoding.totallyexplained.com">Run-length encoding Totally Explained</a>
Then simply click through this link from your web page. Our crawlers will verify your link, extract the title of your web page and instantly add a link back to it. If you like you can remove the words Totally Explained and embed the link in article text.
As long as your link remains in place, we'll keep our link to you right here. Please play fair - our crawlers are watching. Your site must be closely related to this one's topic. Any kind of spamming, dubious practises or removing the link will result in your link from us being dropped and, potentially, your whole site being banned. |